﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HZ.MBSM.DBUtility;
public partial class Bidder_GoodsbidUpdate : System.Web.UI.Page
{
    private string goods_id = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (HZ.MBSM.BLL.Login.CheckAssert(this.UseAccountType))
        {
            HZ.MBSM.Model.Account _Account = (HZ.MBSM.Model.Account)Session["Account"];
            goods_id = SysFun.IsSQL(Request.QueryString["goodsid"]);
            Db db = new Db();
            DbPage dbPage = new DbPage(db);
            dbPage.Table = "product inner join goods on product.productid=goods.productid inner join company on goods.Accountid_sc=company.accountid";                                               //要查询的表名
            dbPage.Key = "product.productid";                                               //表的主键    
            dbPage.Where = "goodsid = '" + goods_id + "' and accountid_sc='" + _Account.AccountId + "'";                                            //查询条件    
            dbPage.SelectField = @" GoodsId,Product.Productid,ProductName,Outlookc,Medicinemodel,Unit,xishu,CASE Goods.QualityLevels when 0 then '普通GMP药品' when 1 then '专利药品' when 2 then '1999年以来获得国家科学技术奖的药品' when 3 then '国家一类新药' when 4 then '原研制药品' when 5 then '单独定价药品' when 6 then '优质优价中成药' when 7 then '全国医药工业百强企业的药品' when 8 then '中药保护品种' when 9 then '欧美认证药品' END AS QualityLevels,case ifbid when '0' then '否' when '1' then '是' end as ifbid";
            dbPage.PageIndex = SysFun.ToInt(Request["CurrentlyPageIndex"]);          //要显示第几页   
            dbPage.PageSize = 10;                                                    //没有显示记录条数   
            dbPage.OrderBy = "productname,medicinemodel,outlookc,product.ProductId";                  //排序字段
            System.Data.IDataReader dr = dbPage.ExecuteReader();
            GridView1.DataSource = dr;
            GridView1.DataBind();
            dr.Close();
            dr.Dispose();
            dbPage.Db.Close();
            db.Close();
            this.DbPageFlip1.DbPage = dbPage;//将数据传给控键

        }
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        string str_xuanze = DropDownList1.Text.ToString();
        int in_ifbid =0;
        switch (str_xuanze)
        { 
            case "选择进行投标":
                in_ifbid = 1;
                break;
            case "选择不进行投标":
                in_ifbid = 0;
                break;
        }
        string sql = " update goods set ifbid=" + in_ifbid + " where goodsid =" + goods_id;
        Db gg = new Db();
        gg.Command(sql);
        gg.Close();
        Response.Write("<script>window.location.href='GoodsList.aspx'</script>");

    }
    #region IPageDescribe 成员


    public string Describe
    {
        get { return ""; }
    }
    public string Name
    {
        get { return "本企业商品信息"; }
    }
    public string ParentName
    {
        get { return "商品维护"; }
    }

    public System.Collections.Generic.List<HZ.MBSM.DAL.AccountType> UseAccountType
    {
        get
        {
            System.Collections.Generic.List<HZ.MBSM.DAL.AccountType> _AccountType = new System.Collections.Generic.List<HZ.MBSM.DAL.AccountType>();
            _AccountType.Add(HZ.MBSM.DAL.AccountType.enumCompany);
            return _AccountType;
        }
    }

    #endregion

     
}
